<template>
  <div style="margin-left: 15px; margin-right: 10px">
    <a-descriptions title="非常规作业许可" bordered>
      <a-descriptions-item label="申请单位">{{ form?.unit || "---" }}</a-descriptions-item>
      <a-descriptions-item label="作业申请时间">
        {{ dayjs(form?.requestTime).format("YYYY-MM-DD") || "---" }}</a-descriptions-item>
      <a-descriptions-item label="作业区域所在单位">{{ form?.unit_located || "---" }}</a-descriptions-item>
      <a-descriptions-item label="属地监督">{{ form?.territorial_oversight || "---" }}</a-descriptions-item>
      <a-descriptions-item label="监护人">{{ form?.guardian || "---" }}</a-descriptions-item>
      <a-descriptions-item label="申请人">{{ form?.applicant || "---" }}</a-descriptions-item>
      <a-descriptions-item label="作业人">{{ form?.operator || "---" }}</a-descriptions-item>
      <a-descriptions-item label="涉及的其他非常规作业、特殊作业">{{ form?.involves_special_operations || "---" }}</a-descriptions-item>
      <a-descriptions-item label="涉及的其他非常规作业、特殊作业许可证编号">
        {{ form?.other_unroutine_operations || "---" }}</a-descriptions-item>
      <a-descriptions-item label="作业地点、部位">{{ form?.wellId || "---" }}</a-descriptions-item>
      <a-descriptions-item label="作业内容">{{ form?.job_content || "---" }}</a-descriptions-item>
      <a-descriptions-item label="是否编制方案">{{ form?.programming ? "是" : "否" || "---" }}</a-descriptions-item>
      <a-descriptions-item label="存在的风险">{{ form?.existential_risks || "---" }}</a-descriptions-item>
    </a-descriptions>
  </div>
</template>
<script setup>
import dayjs from 'dayjs'
import { getDataOne } from '@/api/salvage/workPermit.js'
const props = defineProps({
  reportId: {
    type: String
  }
})
const form = ref({});
// 监听数据变化
watch(() => props.reportId, () => {
  console.log('props.reportId', props.reportId);
  getLicence()
})

// 获取作业许可信息
function getLicence() {
  getDataOne(props.reportId).then(res => {
    form.value = res
    console.log('form', form.value);
  })
}
getLicence()
</script>
